;Assembler header file for OSHeap
;written by DefMod (Dec 31 2005) on Sat Dec 31 14:03:53 2005
;Jonathan Coxhead, jonathan@doves.demon.co.uk, 12 June 1996

        [       :LNOT: :DEF: OSHeap_Hdr
        GBLS    OSHeap_Hdr

        [       :LNOT: :DEF: Get_Types
        GBLS    Get_Types
        ]
        [       :LNOT: :DEF: Types_Hdr
Get_Types                       SETS    "GET oslib/Types.Hdr"
        |
Get_Types                       SETS    ""
        ]
        $Get_Types

        [       :LNOT: :DEF: Get_OS
        GBLS    Get_OS
        ]
        [       :LNOT: :DEF: OS_Hdr
Get_OS                          SETS    "GET oslib/OS.Hdr"
        |
Get_OS                          SETS    ""
        ]
        $Get_OS

;Symbols for constants
Error_HeapBadReason             *       &180
Error_HeapInit                  *       &181
Error_HeapBadDesc               *       &182
Error_HeapBadLink               *       &183
Error_HeapAlloc                 *       &184
Error_HeapNotABlock             *       &185
Error_HeapBadExtend             *       &186
Error_HeapExcessiveShrink       *       &187
Error_HeapHeapLocked            *       &188

;Symbols for SWI's and SWI reason codes
XOS_Heap                        *       &2001D
OS_Heap                         *       &1D

OSHeap_ResizeNoFail             *       &5
   ;Entry
   ;  R0 = &5
   ;  R1 = heap (pointer to data)
   ;  R3 = size_increase (Int)
   ;Exit
   ;  R3 = size_increase_out (Int)

OSHeap_Initialise               *       &0
   ;Entry
   ;  R0 = &0
   ;  R1 = heap (pointer to data)
   ;  R3 = size (Int)

OSHeap_Describe                 *       &1
   ;Entry
   ;  R0 = &1
   ;  R1 -> heap (data)
   ;Exit
   ;  R2 = max (Int)
   ;  R3 = free (Int)

OSHeap_Alloc                    *       &2
   ;Entry
   ;  R0 = &2
   ;  R1 = heap (pointer to data)
   ;  R3 = size (Int)
   ;Exit
   ;  R2 = blk (pointer to Void)

OSHeap_Free                     *       &3
   ;Entry
   ;  R0 = &3
   ;  R1 = heap (pointer to data)
   ;  R2 = blk (pointer to Void)

OSHeap_Realloc                  *       &4
   ;Entry
   ;  R0 = &4
   ;  R1 = heap (pointer to data)
   ;  R2 = blk (pointer to Void)
   ;  R3 = size_increase (Int)
   ;Exit
   ;  R2 = blk_out (pointer to Void)

OSHeap_Resize                   *       &5
   ;Entry
   ;  R0 = &5
   ;  R1 = heap (pointer to data)
   ;  R3 = size_increase (Int)

OSHeap_ReadSize                 *       &6
   ;Entry
   ;  R0 = &6
   ;  R1 -> heap (data)
   ;  R2 = blk (pointer to Void)
   ;Exit
   ;  R3 = size (Int)

        ]
        END
